package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.DropBehavior;
import com.yanmaohu.yulia.bean.GranteeList;
import com.yanmaohu.yulia.bean.Grantor;
import com.yanmaohu.yulia.bean.IdentifierList;

/**
 * @author Bright Lee
 */
public final class RevokeRoleStatement implements RevokeStatement {

    private int beginIndex;
    private int endIndex;
    private boolean adminOptionFor;
    private IdentifierList roleRevokedList;
    private GranteeList granteeList;
    private Grantor grantor;
    private DropBehavior dropBehavior;

    public RevokeRoleStatement(int beginIndex,
                               boolean adminOptionFor,
                               IdentifierList roleRevokedList,
                               GranteeList granteeList,
                               Grantor grantor,
                               DropBehavior dropBehavior) {
        this.beginIndex = beginIndex;
        this.endIndex = dropBehavior.getEndIndex();
        this.adminOptionFor = adminOptionFor;
        this.roleRevokedList = roleRevokedList;
        this.granteeList = granteeList;
        this.grantor = grantor;
        this.dropBehavior = dropBehavior;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isAdminOptionFor() {
        return adminOptionFor;
    }

    public IdentifierList getRoleRevokedList() {
        return roleRevokedList;
    }

    public GranteeList getGranteeList() {
        return granteeList;
    }

    public Grantor getGrantor() {
        return grantor;
    }

    public DropBehavior getDropBehavior() {
        return dropBehavior;
    }

}
